#!/bin/sh
# PCP QA Test No. 847
# Basic tests for pcp-* containers
#
# Copyright (c) 2016 Red Hat.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

. ./common.containers

_check_containers
_check_docker_binary
which atomic >/dev/null 2>&1 || _notrun "no atomic command found"
_check_docker_images pcp-collector pcp-pmlogger pcp-monitor pcp-pmie

status=0
trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15

echo "testing pcp-monitor container basic functionality (using local pmcd)"
$sudo atomic run pcp-monitor $PCP_BIN_DIR/pcp -h localhost >/dev/null 2>&1 || exit 1
$docker rm `docker ps -aq` >/dev/null 2>&1

$sudo atomic run pcp-monitor $PCP_BIN_DIR/pcp iostat -s 2 -h localhost >/dev/null 2>&1 || exit 1
$docker rm `docker ps -aq` >/dev/null 2>&1

# success, all done
status=0
exit
